<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <?php $this->load->view('head'); ?>
        <script src="<?php echo base_url() . "js/jquery.jqplot.min.js" ?>" type="text/javascript"></script>
        <script src="<?php echo base_url() . "js/jqplot.barRenderer.min.js" ?>" type="text/javascript"></script>
        <script src="<?php echo base_url() . "js/jqplot.categoryAxisRenderer.min.js" ?>" type="text/javascript"></script>
<!--        <script src="<?php echo base_url() . "js/jqplot.cursor.min.js" ?>" type="text/javascript"></script>-->
        <script src="<?php echo base_url() . "js/jqplot.highlighter.min.js" ?>" type="text/javascript"></script>
        
        
<!--  <script language="javascript" type="text/javascript" src="../plugins/jqplot.dateAxisRenderer.js"></script>
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.barRenderer.js"></script>
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.js"></script>
   <script language="javascript" type="text/javascript" src="../plugins/jqplot.cursor.js"></script>
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.highlighter.js"></script>
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.dragable.js"></script>
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.trendline.js"></script>-->
        
        
        <link type="text/css" href="<?php echo base_url() . "css/jquery.jqplot.css"; ?>" rel="stylesheet" />
        <script type="text/javascript">
            var global = "";
            $(document).ready(function(){                
<?php $this->load->view('enReady'); ?>
        $("#fecIni").datepicker({dateFormat:"yy-mm-dd",changeMonth: true,changeYear: true});
        $("#fecFin").datepicker({dateFormat:"yy-mm-dd",changeMonth: true,changeYear: true });
        $("#dpto").change(function(){
            if($(this).val() != ""){
                $("#divCiudades").css("display","block");
                url = "<?php echo site_url("registro/ciudad/"); ?>/" + $(this).val();
                $("#divCiudades").load(url,function(){
                    $("#ciudad").val(global);
                });
            }else{
                $("#divCiudades").css("display","none");
            }
        }); //fin $("#dpto").change(function(){
    }); //fin $(document).ready(function(){           
    
    function fnEnvia(){
        $("#chart3").html('');
        $("#divGraficaScript").load("<?php echo site_url("indicadores/graficaPostulados"); ?>", $("#frmConsulta").serialize(),function(){});
    } //fin fnEnvia
        </script>
        <style type="text/css" media="screen">
            .jqplot-axis {
                font-size: 0.85em;
            }
            .jqplot-legend {
                font-size: 0.75em;
            }
        </style>
    </head>
    <body>
        <div class="divTitulo">POSTULADOS vs CONTRATADOS</div>
        <div id="divContenedor">
            <?php $this->load->view('enBody'); ?>
            <form id="frmConsulta" method="POST">
                <table>
                    <tr>
                        <td><label for="fecIni">Fecha Inicio</label></td>
                        <td><input type="text" id="fecIni" name="fecIni" title="Rengo inicial de la fecha de postulación" size="9" /> </td>
                        <td><label for="fecFin">Fecha Final</label></td>
                        <td><input type="text" id="fecFin" name="fecFin" size="9" title="Rango final de la fecha de postulación"   /> </td>
                    </tr>
                    <tr>
                        <td><label for="dpto">Departamento</label></td>
                        <td>
                            <select id="dpto" name="dpto" title="Departamento de las postulaciones">
                                <option value="">Elija</option>
                                <?php
                                foreach ($dep->result() as $row) {
                                    $tmp = ($dpto == $row->dptCod) ? "selected" : "";
                                    echo "<option value='" . $row->dptCod . "' $tmp>" . $row->departamento . "</option>";
                                }
                                ?>
                            </select>
                        </td>
                        <td><label for="ciudad">Ciudad</label></td>
                        <td><div id="divCiudades"></div> </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="text-align: center"><input type="button" value="Consultar" onclick="fnEnvia()" /> </td>
                    </tr>
                </table>
            </form>
        </div> <!-- fin divContenedor -->
        <div id="divGraficaScript"></div>
        <div id="chart3" style="width:400px; height:400px;"></div>
    </body>
</html>
